<!DOCTYPE html>
<html>

<head>
  <title>Quarkus - Hibernate Search guide</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/guides/hibernate-search-elasticsearch" />
  <meta property="og:title" content="Quarkus - Hibernate Search guide" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/guides/hibernate-search-elasticsearch">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="guides">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="active">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="guide">
  <div class="width-12-12">
    <h1 class="text-caps">Quarkus - Hibernate Search guide</h1>
    <div class="hide-mobile toc"><ul class="sectlevel1">
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#architecture">Architecture</a></li>
<li><a href="#solution">Solution</a></li>
<li><a href="#creating-the-maven-project">Creating the Maven project</a></li>
<li><a href="#creating-the-bare-entities">Creating the bare entities</a></li>
<li><a href="#initializing-the-rest-service">Initializing the REST service</a></li>
<li><a href="#using-hibernate-search-annotations">Using Hibernate Search annotations</a></li>
<li><a href="#analyzers-and-normalizers">Analyzers and normalizers</a>
<ul class="sectlevel2">
<li><a href="#introduction">Introduction</a></li>
<li><a href="#defining-the-analyzers-used">Defining the analyzers used</a></li>
<li><a href="#setting-up-the-analyzers">Setting up the analyzers</a></li>
</ul>
</li>
<li><a href="#adding-full-text-capabilities-to-our-rest-service">Adding full text capabilities to our REST service</a></li>
<li><a href="#configuring-the-application">Configuring the application</a></li>
<li><a href="#creating-a-frontend">Creating a frontend</a></li>
<li><a href="#automatic-import-script">Automatic import script</a></li>
<li><a href="#preparing-the-infrastructure">Preparing the infrastructure</a></li>
<li><a href="#time-to-play-with-your-application">Time to play with your application</a></li>
<li><a href="#building-a-native-executable">Building a native executable</a></li>
<li><a href="#further-reading">Further reading</a></li>
<li><a href="#faq">FAQ</a>
<ul class="sectlevel2">
<li><a href="#why-hibernate-search-6-and-not-a-fully-supported-version">Why Hibernate Search 6 (and not a fully supported version)?</a></li>
<li><a href="#can-i-really-use-it">Can I really use it?</a></li>
<li><a href="#why-elasticsearch-only">Why Elasticsearch only?</a></li>
</ul>
</li>
<li><a href="#configuration-reference">Hibernate Search Configuration Reference</a></li>
</ul></div>
    <div>
      <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>You have a Hibernate ORM-based application? You want to provide a full-featured full-text search to your users? You&#8217;re at the right place.</p>
</div>
<div class="paragraph">
<p>With this guide, you&#8217;ll learn how to synchronize your entities to an Elasticsearch cluster in a heart beat with Hibernate Search.
We will also explore how you can can query your Elasticsearch cluster using the Hibernate Search API.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>This technology is considered preview.</p>
</div>
<div class="paragraph">
<p>In <em>preview</em>, backward compatibility and presence in the ecosystem is not guaranteed.
Specific improvements might require to change configuration or APIs and plans to become <em>stable</em> are under way.
Feedback is welcome on our <a href="https://groups.google.com/d/forum/quarkus-dev">mailing list</a> or as issues in our <a href="https://github.com/quarkusio/quarkus/issues">GitHub issue tracker</a>.</p>
</div>
<div class="paragraph">
<p>For a full list of possible extension statuses, check our <a href="https://quarkus.io/faq/#extension-status">FAQ entry</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
<div class="paragraph">
<p>This extension is based on a beta version of Hibernate Search.
While APIs are quite stable and the code is of production quality and thoroughly tested, some features are still missing, performance might not be optimal and some APIs or configuration properties might change as the extension matures.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="prerequisites"><a class="anchor" href="#prerequisites"></a>Prerequisites</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To complete this guide, you need:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>less than 20 minutes</p>
</li>
<li>
<p>an IDE</p>
</li>
<li>
<p>JDK 1.8+ installed with <code>JAVA_HOME</code> configured appropriately</p>
</li>
<li>
<p>Apache Maven 3.6.2+</p>
</li>
<li>
<p>Docker</p>
</li>
<li>
<p><a href="building-native-image">GraalVM installed if you want to run in native mode</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="architecture"><a class="anchor" href="#architecture"></a>Architecture</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The application described in this guide allows to manage a (simple) library: you manage authors and their books.</p>
</div>
<div class="paragraph">
<p>The entities are stored in a PostgreSQL database and indexed in an Elasticsearch cluster.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="solution"><a class="anchor" href="#solution"></a>Solution</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We recommend that you follow the instructions in the next sections and create the application step by step.
However, you can go right to the completed example.</p>
</div>
<div class="paragraph">
<p>Clone the Git repository: <code>git clone <a href="https://github.com/quarkusio/quarkus-quickstarts.git" class="bare">https://github.com/quarkusio/quarkus-quickstarts.git</a></code>, or download an <a href="https://github.com/quarkusio/quarkus-quickstarts/archive/master.zip">archive</a>.</p>
</div>
<div class="paragraph">
<p>The solution is located in the <code>hibernate-search-elasticsearch-quickstart</code> <a href="https://github.com/quarkusio/quarkus-quickstarts/tree/master/hibernate-search-elasticsearch-quickstart">directory</a>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The provided solution contains a few additional elements such as tests and testing infrastructure.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="creating-the-maven-project"><a class="anchor" href="#creating-the-maven-project"></a>Creating the Maven project</h2>
<div class="sectionbody">
<div class="paragraph">
<p>First, we need a new project. Create a new project with the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">mvn io.quarkus:quarkus-maven-plugin:1.7.0.Final:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=hibernate-search-elasticsearch-quickstart \
    -DclassName="org.acme.hibernate.search.elasticsearch.LibraryResource" \
    -Dpath="/library" \
    -Dextensions="hibernate-orm-panache, hibernate-search-elasticsearch, resteasy-jsonb, jdbc-postgresql"
cd hibernate-search-elasticsearch-quickstart</code></pre>
</div>
</div>
<div class="paragraph">
<p>This command generates a Maven structure importing the following extensions:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Hibernate ORM with Panache,</p>
</li>
<li>
<p>the PostgreSQL JDBC driver,</p>
</li>
<li>
<p>Hibernate Search + Elasticsearch,</p>
</li>
<li>
<p>RESTEasy and JSON-B.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If you already have your Quarkus project configured, you can add the <code>hibernate-search-elasticsearch</code> extension
to your project by running the following command in your project base directory:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="bash" class="language-bash hljs">./mvnw quarkus:add-extension -Dextensions="hibernate-search-elasticsearch"</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will add the following to your <code>pom.xml</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-hibernate-search-elasticsearch&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>For now, let&#8217;s delete the two generated tests <code>LibraryResourceTest</code> and <code>NativeLibraryResourceIT</code> present in <code>src/test/java</code>.
If you are interested in how you can test this application, just refer to the solution in the quickstarts Git repository:
it contains a lot of tests and the required testing infrastructure.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="creating-the-bare-entities"><a class="anchor" href="#creating-the-bare-entities"></a>Creating the bare entities</h2>
<div class="sectionbody">
<div class="paragraph">
<p>First, let&#8217;s create our Hibernate ORM entities <code>Book</code> and <code>Author</code> in the <code>model</code> subpackage.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.hibernate.search.elasticsearch.model;

import java.util.List;
import java.util.Objects;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

@Entity
public class Author extends PanacheEntity { <i class="conum" data-value="1"></i><b>(1)</b>

    public String firstName;

    public String lastName;

    @OneToMany(mappedBy = "author", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) <i class="conum" data-value="2"></i><b>(2)</b>
    public List&lt;Book&gt; books;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Author)) {
            return false;
        }

        Author other = (Author) o;

        return Objects.equals(id, other.id);
    }

    @Override
    public int hashCode() {
        return 31;
    }
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>We are using Hibernate ORM with Panache, it is not mandatory.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>We are loading these elements eagerly so that they are present in the JSON output.
In a real world application, you should probably use a DTO approach.</td>
</tr>
</table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.hibernate.search.elasticsearch.model;

import java.util.Objects;

import javax.json.bind.annotation.JsonbTransient;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

@Entity
public class Book extends PanacheEntity {

    public String title;

    @ManyToOne
    @JsonbTransient <i class="conum" data-value="1"></i><b>(1)</b>
    public Author author;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Book)) {
            return false;
        }

        Book other = (Book) o;

        return Objects.equals(id, other.id);
    }

    @Override
    public int hashCode() {
        return 31;
    }
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>We mark this property with <code>@JsonbTransient</code> to avoid infinite loops when serializing with JSON-B.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="initializing-the-rest-service"><a class="anchor" href="#initializing-the-rest-service"></a>Initializing the REST service</h2>
<div class="sectionbody">
<div class="paragraph">
<p>While everything is not yet set up for our REST service, we can initialize it with the standard CRUD operations we will need.</p>
</div>
<div class="paragraph">
<p>Just copy this content in the <code>LibraryResource</code> file created by the Maven <code>create-project</code> command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.hibernate.search.elasticsearch;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.transaction.Transactional;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.acme.hibernate.search.elasticsearch.model.Author;
import org.acme.hibernate.search.elasticsearch.model.Book;
import org.jboss.resteasy.annotations.jaxrs.FormParam;
import org.jboss.resteasy.annotations.jaxrs.PathParam;

@Path("/library")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class LibraryResource {

    @Inject
    EntityManager em;

    @PUT
    @Path("book")
    @Transactional
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public void addBook(@FormParam String title, @FormParam Long authorId) {
        Author author = Author.findById(authorId);
        if (author == null) {
            return;
        }

        Book book = new Book();
        book.title = title;
        book.author = author;
        book.persist();

        author.books.add(book);
        author.persist();
    }

    @DELETE
    @Path("book/{id}")
    @Transactional
    public void deleteBook(@PathParam Long id) {
        Book book = Book.findById(id);
        if (book != null) {
            book.author.books.remove(book);
            book.delete();
        }
    }

    @PUT
    @Path("author")
    @Transactional
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public void addAuthor(@FormParam String firstName, @FormParam String lastName) {
        Author author = new Author();
        author.firstName = firstName;
        author.lastName = lastName;
        author.persist();
    }

    @POST
    @Path("author/{id}")
    @Transactional
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public void updateAuthor(@PathParam Long id, @FormParam String firstName, @FormParam String lastName) {
        Author author = Author.findById(id);
        if (author == null) {
            return;
        }
        author.firstName = firstName;
        author.lastName = lastName;
        author.persist();
    }

    @DELETE
    @Path("author/{id}")
    @Transactional
    public void deleteAuthor(@PathParam Long id) {
        Author author = Author.findById(id);
        if (author != null) {
            author.delete();
        }
    }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Nothing out of the ordinary here: it is just good old Hibernate ORM with Panache operations in a standard JAX-RS service.</p>
</div>
<div class="paragraph">
<p>In fact, the interesting part is that we will need to add very few elements to make our full text search application working.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="using-hibernate-search-annotations"><a class="anchor" href="#using-hibernate-search-annotations"></a>Using Hibernate Search annotations</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Let&#8217;s go back to our entities.</p>
</div>
<div class="paragraph">
<p>Enabling full text search capabilities for them is as simple as adding a few annotations.</p>
</div>
<div class="paragraph">
<p>Let&#8217;s edit the <code>Author</code> entity again to include this content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.hibernate.search.elasticsearch.model;

import java.util.Objects;

import javax.json.bind.annotation.JsonbTransient;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

@Entity
@Indexed <i class="conum" data-value="1"></i><b>(1)</b>
public class Book extends PanacheEntity {

    @FullTextField(analyzer = "english") <i class="conum" data-value="2"></i><b>(2)</b>
    public String title;

    @ManyToOne
    @JsonbTransient
    public Author author;

    // Preexisting equals()/hashCode() methods
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>First, let&#8217;s use the <code>@Indexed</code> annotation to register our <code>Book</code> entity as part of the full text index.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The <code>@FullTextField</code> annotation declares a field in the index specifically tailored for full text search.
In particular, we have to define an analyzer to split and analyze the tokens (~ words) - more on this later.</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Now that our books are indexed, we can do the same for the authors.</p>
</div>
<div class="paragraph">
<p>Open the <code>Author</code> class and include the content below.</p>
</div>
<div class="paragraph">
<p>Things are quite similar here: we use the <code>@Indexed</code>, <code>@FullTextField</code> and <code>@KeywordField</code> annotations.</p>
</div>
<div class="paragraph">
<p>There are a few differences/additions though. Let&#8217;s check them out.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.hibernate.search.elasticsearch.model;

import java.util.List;
import java.util.Objects;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;

import org.hibernate.search.engine.backend.types.Sortable;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

@Entity
@Indexed
public class Author extends PanacheEntity {

    @FullTextField(analyzer = "name") <i class="conum" data-value="1"></i><b>(1)</b>
    @KeywordField(name = "firstName_sort", sortable = Sortable.YES, normalizer = "sort") <i class="conum" data-value="2"></i><b>(2)</b>
    public String firstName;

    @FullTextField(analyzer = "name")
    @KeywordField(name = "lastName_sort", sortable = Sortable.YES, normalizer = "sort")
    public String lastName;

    @OneToMany(mappedBy = "author", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
    @IndexedEmbedded <i class="conum" data-value="3"></i><b>(3)</b>
    public List&lt;Book&gt; books;

    // Preexisting equals()/hashCode() methods
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>We use a <code>@FullTextField</code> similar to what we did for <code>Book</code> but you&#8217;ll notice that the analyzer is different - more on this later.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>As you can see, we can define several fields for the same property.
Here, we define a <code>@KeywordField</code> with a specific name.
The main difference is that a keyword field is not tokenized (the string is kept as one single token) but can be normalized (i.e. filtered) - more on this later.
This field is marked as sortable as our intention is to use it for sorting our authors.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The purpose of <code>@IndexedEmbedded</code> is to include the <code>Book</code> fields into the <code>Author</code> index.
In this case, we just use the default configuration: all the fields of the associated <code>Book</code> entities are included in the index (i.e. the <code>title</code> field).
The nice thing with <code>@IndexedEmbedded</code> is that it is able to automatically reindex an <code>Author</code> if one of its <code>Book</code>s has been updated thanks to the bidirectional relation.
<code>@IndexedEmbedded</code> also supports nested documents (using the <code>storage = NESTED</code> attribute) but we don&#8217;t need it here.
You can also specify the fields you want to include in your parent index using the <code>includePaths</code> attribute if you don&#8217;t want them all.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="analyzers-and-normalizers"><a class="anchor" href="#analyzers-and-normalizers"></a>Analyzers and normalizers</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="introduction"><a class="anchor" href="#introduction"></a>Introduction</h3>
<div class="paragraph">
<p>Analysis is a big part of full text search: it defines how text will be processed when indexing or building search queries.</p>
</div>
<div class="paragraph">
<p>The role of analyzers is to split the text into tokens (~ words) and filter them (making it all lowercase and removing accents for instance).</p>
</div>
<div class="paragraph">
<p>Normalizers are a special type of analyzers that keeps the input as a single token.
It is especially useful for sorting or indexing keywords.</p>
</div>
<div class="paragraph">
<p>There are a lot of bundled analyzers but you can also develop your own for your own specific purposes.</p>
</div>
<div class="paragraph">
<p>You can learn more about the Elasticsearch analysis framework in the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html">Analysis section of the Elasticsearch documentation</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="defining-the-analyzers-used"><a class="anchor" href="#defining-the-analyzers-used"></a>Defining the analyzers used</h3>
<div class="paragraph">
<p>When we added the Hibernate Search annotations to our entities, we defined the analyzers and normalizers used.
Typically:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">@FullTextField(analyzer = "english")</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">@FullTextField(analyzer = "name")</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">@KeywordField(name = "lastName_sort", sortable = Sortable.YES, normalizer = "sort")</code></pre>
</div>
</div>
<div class="paragraph">
<p>We use:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>an analyzer called <code>name</code> for person names,</p>
</li>
<li>
<p>an analyzer called <code>english</code> for book titles,</p>
</li>
<li>
<p>a normalizer called <code>sort</code> for our sort fields</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>but we haven&#8217;t set them up yet.</p>
</div>
<div class="paragraph">
<p>Let&#8217;s see how you can do it with Hibernate Search.</p>
</div>
</div>
<div class="sect2">
<h3 id="setting-up-the-analyzers"><a class="anchor" href="#setting-up-the-analyzers"></a>Setting up the analyzers</h3>
<div class="paragraph">
<p>It is an easy task, we just need to create an implementation of <code>ElasticsearchAnalysisConfigurer</code>
(and configure Quarkus to use it, more on that later).</p>
</div>
<div class="paragraph">
<p>To fulfill our requirements, let&#8217;s create the following implementation:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.hibernate.search.elasticsearch.config;

import org.hibernate.search.backend.elasticsearch.analysis.ElasticsearchAnalysisConfigurationContext;
import org.hibernate.search.backend.elasticsearch.analysis.ElasticsearchAnalysisConfigurer;

public class AnalysisConfigurer implements ElasticsearchAnalysisConfigurer {

    @Override
    public void configure(ElasticsearchAnalysisConfigurationContext context) {
        context.analyzer("name").custom() <i class="conum" data-value="1"></i><b>(1)</b>
                .tokenizer("standard")
                .tokenFilters("asciifolding", "lowercase");

        context.analyzer("english").custom() <i class="conum" data-value="2"></i><b>(2)</b>
                .tokenizer("standard")
                .tokenFilters("asciifolding", "lowercase", "porter_stem");

        context.normalizer("sort").custom() <i class="conum" data-value="3"></i><b>(3)</b>
                .tokenFilters("asciifolding", "lowercase");
    }
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>This is a simple analyzer separating the words on spaces, removing any non-ASCII characters by its ASCII counterpart (and thus removing accents) and putting everything in lowercase.
It is used in our examples for the author&#8217;s names.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>We are a bit more aggressive with this one and we include some stemming: we will be able to search for <code>mystery</code> and get a result even if the indexed input contains <code>mysteries</code>.
It is definitely too aggressive for person names but it is perfect for the book titles.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Here is the normalizer used for sorting. Very similar to our first analyzer, except we don&#8217;t tokenize the words as we want one and only one token.</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="adding-full-text-capabilities-to-our-rest-service"><a class="anchor" href="#adding-full-text-capabilities-to-our-rest-service"></a>Adding full text capabilities to our REST service</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In our existing <code>LibraryResource</code>, we just need to inject the following methods (and add a few <code>import</code>s):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">    @Transactional <i class="conum" data-value="1"></i><b>(1)</b>
    void onStart(@Observes StartupEvent ev) throws InterruptedException { <i class="conum" data-value="2"></i><b>(2)</b>
        // only reindex if we imported some content
        if (Book.count() &gt; 0) {
            Search.session(em)
                    .massIndexer()
                    .startAndWait();
        }
    }

    @GET
    @Path("author/search") <i class="conum" data-value="3"></i><b>(3)</b>
    @Transactional
    public List&lt;Author&gt; searchAuthors(@QueryParam String pattern, <i class="conum" data-value="4"></i><b>(4)</b>
            @QueryParam Optional&lt;Integer&gt; size) {
        return Search.session(em) <i class="conum" data-value="5"></i><b>(5)</b>
                .search(Author.class) <i class="conum" data-value="6"></i><b>(6)</b>
                .where(f -&gt;
                    pattern == null || pattern.trim().isEmpty() ?
                            f.matchAll() : <i class="conum" data-value="7"></i><b>(7)</b>
                            f.simpleQueryString()
                                .fields("firstName", "lastName", "books.title").matching(pattern) <i class="conum" data-value="8"></i><b>(8)</b>
                )
                .sort(f -&gt; f.field("lastName_sort").then().field("firstName_sort")) <i class="conum" data-value="9"></i><b>(9)</b>
                .fetchHits(size.orElse(20)); <i class="conum" data-value="10"></i><b>(10)</b>
    }</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Important point: we need a transactional context for these methods.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>As we will import data into the PostgreSQL database using an SQL script, we need to reindex the data at startup.
For this, we use Hibernate Search&#8217;s mass indexer, which allows to index a lot of data efficiently (you can fine tune it for better performances).
All the upcoming updates coming through Hibernate ORM operations will be synchronized automatically to the full text index.
If you don&#8217;t import data manually in the database, you don&#8217;t need that:
the mass indexer should then only be used when you change your indexing configuration (adding a new field, changing an analyzer&#8217;s configuration&#8230;&#8203;) and you want the new configuration to be applied to your existing entities.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>This is where the magic begins: just adding the annotations to our entities makes them available for full text search: we can now query the index using the Hibernate Search DSL.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Use the <code>org.jboss.resteasy.annotations.jaxrs.QueryParam</code> annotation type to avoid repeating the parameter name.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>First, we get an Hibernate Search session from the injected entity manager.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>We indicate that we are searching for <code>Author</code>s.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>We create a predicate: if the pattern is empty, we use a <code>matchAll()</code> predicate.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>If we have a valid pattern, we create a <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html"><code>simpleQueryString()</code></a> predicate on the <code>firstName</code>, <code>lastName</code> and <code>books.title</code> fields matching our pattern.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>We define the sort order of our results. Here we sort by last name, then by first name. Note that we use the specific fields we created for sorting.</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>Fetch the <code>size</code> top hits, <code>20</code> by default. Obviously, paging is also supported.</td>
</tr>
</table>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The Hibernate Search DSL supports a significant subset of the Elasticsearch predicates (match, range, nested, phrase, spatial&#8230;&#8203;).
Feel free to explore the DSL using autocompletion.</p>
</div>
<div class="paragraph">
<p>When that&#8217;s not enough, you can always fall back to
<a href="https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#search-dsl-predicate-extensions-elasticsearch-from-json">defining a predicate using JSON directly</a>.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuring-the-application"><a class="anchor" href="#configuring-the-application"></a>Configuring the application</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As usual, we can configure everything in the Quarkus configuration file, <code>application.properties</code>.</p>
</div>
<div class="paragraph">
<p>Edit <code>src/main/resources/application.properties</code> and inject the following configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.ssl.native=false <i class="conum" data-value="1"></i><b>(1)</b>

quarkus.datasource.db-kind=postgresql <i class="conum" data-value="2"></i><b>(2)</b>
quarkus.datasource.username=quarkus_test
quarkus.datasource.password=quarkus_test
quarkus.datasource.jdbc.url=jdbc:postgresql:quarkus_test

quarkus.hibernate-orm.database.generation=drop-and-create <i class="conum" data-value="3"></i><b>(3)</b>
quarkus.hibernate-orm.sql-load-script=import.sql <i class="conum" data-value="4"></i><b>(4)</b>

quarkus.hibernate-search.elasticsearch.version=7 <i class="conum" data-value="5"></i><b>(5)</b>
quarkus.hibernate-search.elasticsearch.analysis.configurer=org.acme.hibernate.search.elasticsearch.config.AnalysisConfigurer <i class="conum" data-value="6"></i><b>(6)</b>
quarkus.hibernate-search.schema-management.strategy=drop-and-create <i class="conum" data-value="7"></i><b>(7)</b>
quarkus.hibernate-search.elasticsearch.index-defaults.schema-management.required-status=yellow <i class="conum" data-value="8"></i><b>(8)</b>
quarkus.hibernate-search.automatic-indexing.synchronization.strategy=sync <i class="conum" data-value="9"></i><b>(9)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>We won&#8217;t use SSL so we disable it to have a more compact native executable.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Let&#8217;s create a PostgreSQL datasource.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>We will drop and recreate the schema every time we start the application.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>We load some initial data.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>We need to tell Hibernate Search about the version of Elasticsearch we will use.
It is important because there are significant differences between Elasticsearch mapping syntax depending on the version.
Since the mapping is created at build time to reduce startup time, Hibernate Search cannot connect to the cluster to automatically detect the version.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>We point to the custom <code>AnalysisConfigurer</code> which defines the configuration of our analyzers and normalizers.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Obviously, this is not for production: we drop and recreate the index every time we start the application.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>We consider the <code>yellow</code> status is sufficient to proceed after an index is created.
This is for testing purposes with the Elasticsearch Docker container.
It should not be used in production.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>This means that we wait for the entities to be searchable before considering a write complete.
On a production setup, the <code>write-sync</code> default will provide better performance.
Using <code>sync</code> is especially important when testing as you need the entities to be searchable immediately.</td>
</tr>
</table>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
For more information about the Hibernate Search extension configuration please refer to the <a href="#configuration-reference">Configuration Reference</a>.
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="creating-a-frontend"><a class="anchor" href="#creating-a-frontend"></a>Creating a frontend</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Now let&#8217;s add a simple web page to interact with our <code>LibraryResource</code>.
Quarkus automatically serves static resources located under the <code>META-INF/resources</code> directory.
In the <code>src/main/resources/META-INF/resources</code> directory, overwrite the existing <code>index.html</code> file with the content from this
<a href="https://github.com/quarkusio/quarkus-quickstarts/blob/master/hibernate-search-elasticsearch-quickstart/src/main/resources/META-INF/resources/index.html">index.html</a> file.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="automatic-import-script"><a class="anchor" href="#automatic-import-script"></a>Automatic import script</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For the purpose of this demonstration, let&#8217;s import an initial dataset.</p>
</div>
<div class="paragraph">
<p>Let&#8217;s create a <code>src/main/resources/import.sql</code> file with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="sql" class="language-sql hljs">INSERT INTO author(id, firstname, lastname) VALUES (nextval('hibernate_sequence'), 'John', 'Irving');
INSERT INTO author(id, firstname, lastname) VALUES (nextval('hibernate_sequence'), 'Paul', 'Auster');

INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'The World According to Garp', 1);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'The Hotel New Hampshire', 1);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'The Cider House Rules', 1);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'A Prayer for Owen Meany', 1);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'Last Night in Twisted River', 1);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'In One Person', 1);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'Avenue of Mysteries', 1);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'The New York Trilogy', 2);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'Mr. Vertigo', 2);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'The Brooklyn Follies', 2);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'Invisible', 2);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), 'Sunset Park', 2);
INSERT INTO book(id, title, author_id) VALUES (nextval('hibernate_sequence'), '4 3 2 1', 2);</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="preparing-the-infrastructure"><a class="anchor" href="#preparing-the-infrastructure"></a>Preparing the infrastructure</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We need a PostgreSQL instance and an Elasticsearch cluster.</p>
</div>
<div class="paragraph">
<p>Let&#8217;s use Docker to start one of each:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">docker run -it --rm=true --name elasticsearch_quarkus_test -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch-oss:{elasticsearch-version}</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">docker run --ulimit memlock=-1:-1 -it --rm=true --memory-swappiness=0 --name postgresql_quarkus_test -e POSTGRES_USER=quarkus_test -e POSTGRES_PASSWORD=quarkus_test -e POSTGRES_DB=quarkus_test -p 5432:5432 postgres:11.3</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="time-to-play-with-your-application"><a class="anchor" href="#time-to-play-with-your-application"></a>Time to play with your application</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You can now interact with your REST service:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>start Quarkus with <code>./mvnw compile quarkus:dev</code></p>
</li>
<li>
<p>open a browser to <code><a href="http://localhost:8080/" class="bare">http://localhost:8080/</a></code></p>
</li>
<li>
<p>search for authors or book titles (we initialized some data for you)</p>
</li>
<li>
<p>create new authors and books and search for them too</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>As you can see, all your updates are automatically synchronized to the Elasticsearch cluster.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="building-a-native-executable"><a class="anchor" href="#building-a-native-executable"></a>Building a native executable</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You can build a native executable with the usual command <code>./mvnw package -Pnative</code>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>As usual with native executable compilation, this operation consumes a lot of memory.</p>
</div>
<div class="paragraph">
<p>It might be safer to stop the two containers while you are building the native executable and start them again once you are done.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Running it is as simple as executing <code>./target/hibernate-search-elasticsearch-quickstart-1.0-SNAPSHOT-runner</code>.</p>
</div>
<div class="paragraph">
<p>You can then point your browser to <code><a href="http://localhost:8080/" class="bare">http://localhost:8080/</a></code> and use your application.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The startup is a bit slower than usual: it is mostly due to us dropping and recreating the database schema and the Elasticsearch mapping every time at startup.
We also inject some data and execute the mass indexer.</p>
</div>
<div class="paragraph">
<p>In a real life application, it is obviously something you won&#8217;t do at startup.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="further-reading"><a class="anchor" href="#further-reading"></a>Further reading</h2>
<div class="sectionbody">
<div class="paragraph">
<p>If you are interested into learning more about Hibernate Search 6, the Hibernate team has <a href="https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/">some documentation</a> in the works.</p>
</div>
<div class="paragraph">
<p>It is still work in progress but covers all main concepts and features,
so it can guide you in your exploration.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="faq"><a class="anchor" href="#faq"></a>FAQ</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="why-hibernate-search-6-and-not-a-fully-supported-version"><a class="anchor" href="#why-hibernate-search-6-and-not-a-fully-supported-version"></a>Why Hibernate Search 6 (and not a fully supported version)?</h3>
<div class="paragraph">
<p>To optimize the Hibernate Search bootstrap for Quarkus, the Hibernate team had to reorganize things a bit (collect the metadata offline, start the Elasticsearch client later&#8230;&#8203;).</p>
</div>
<div class="paragraph">
<p>This couldn&#8217;t be done in the 5.x code base so we decided to go with the in-progress Hibernate Search 6.</p>
</div>
</div>
<div class="sect2">
<h3 id="can-i-really-use-it"><a class="anchor" href="#can-i-really-use-it"></a>Can I really use it?</h3>
<div class="paragraph">
<p>While Hibernate Search 6 is still at Beta stage, the code is of production quality and can be relied on.</p>
</div>
<div class="paragraph">
<p>What we don&#8217;t guarantee is that there might be API changes along the way to the final release of Hibernate Search 6 and you might have to adapt your code.</p>
</div>
<div class="paragraph">
<p>If it is not a major issue for you, then sure you can use it.</p>
</div>
</div>
<div class="sect2">
<h3 id="why-elasticsearch-only"><a class="anchor" href="#why-elasticsearch-only"></a>Why Elasticsearch only?</h3>
<div class="paragraph">
<p>Hibernate Search supports both a Lucene backend and an Elasticsearch backend.</p>
</div>
<div class="paragraph">
<p>In the context of Quarkus and to build microservices, we thought the latter would make more sense.
Thus we focused our efforts on it.</p>
</div>
<div class="paragraph">
<p>We don&#8217;t have plans to support the Lucene backend in Quarkus for now.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuration-reference"><a class="anchor" href="#configuration-reference"></a>Hibernate Search Configuration Reference</h2>
<div class="sectionbody">
<div class="paragraph configuration-legend">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> Configuration property fixed at build time - All other configuration properties are overridable at runtime</p>
</div>
<table class="tableblock frame-all grid-all stretch configuration-reference searchable">
<colgroup>
<col style="width: 80%;">
<col style="width: 10%;">
<col style="width: 10%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-hibernate-search-elasticsearch_configuration"></a><a href="#quarkus-hibernate-search-elasticsearch_configuration">Configuration property</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.background-failure-handler"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.background-failure-handler">quarkus.hibernate-search.background-failure-handler</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The class or the name of the bean that should be notified of any failure occurring in a background process (mainly index operations).
 Must implement <code>org.hibernate.search.engine.reporting.FailureHandler</code>.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">class name</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.schema-management.strategy"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.schema-management.strategy">quarkus.hibernate-search.schema-management.strategy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The strategy used for index lifecycle.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>none</code>, <code>validate</code>, <code>create</code>, <code>create-or-validate</code>, <code>create-or-update</code>, <code>drop-and-create</code>, <code>drop-and-create-and-drop</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>create-or-validate</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.query.loading.cache-lookup.strategy"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.query.loading.cache-lookup.strategy">quarkus.hibernate-search.query.loading.cache-lookup.strategy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The strategy to use when loading entities during the execution of a search query.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>skip</code>, <code>persistence-context</code>, <code>persistence-context-then-second-level-cache</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>skip</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.query.loading.fetch-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.query.loading.fetch-size">quarkus.hibernate-search.query.loading.fetch-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The fetch size to use when loading entities during the execution of a search query.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>100</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.automatic-indexing.synchronization.strategy"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.automatic-indexing.synchronization.strategy">quarkus.hibernate-search.automatic-indexing.synchronization.strategy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The synchronization strategy to use when indexing automatically.</p>
</div>
<div class="paragraph">
<p>Defines how complete indexing should be before resuming the application thread
after a database transaction is committed.</p>
</div>
<div class="paragraph">
<p>Available values:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-left valign-top" rowspan="2"><p class="tableblock">Strategy</p></th>
<th class="tableblock halign-left valign-top" rowspan="2"><p class="tableblock">Throughput</p></th>
<th class="tableblock halign-center valign-top" colspan="3"><p class="tableblock">Guarantees when the application thread resumes</p></th>
</tr>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock">Changes applied</p></th>
<th class="tableblock halign-left valign-top"><p class="tableblock">Changes safe from crash/power loss</p></th>
<th class="tableblock halign-left valign-top"><p class="tableblock">Changes visible on search</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">async</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Best</p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon red"><i class="fa fa-times"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon red"><i class="fa fa-times"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon red"><i class="fa fa-times"></i></span></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">write-sync (<strong>default</strong>)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Medium</p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon lime"><i class="fa fa-check"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon lime"><i class="fa fa-check"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon red"><i class="fa fa-times"></i></span></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">read-sync</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Medium to worst</p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon lime"><i class="fa fa-check"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon red"><i class="fa fa-times"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon lime"><i class="fa fa-check"></i></span></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">sync</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Worst</p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon lime"><i class="fa fa-check"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon lime"><i class="fa fa-check"></i></span></p></td>
<td class="tableblock halign-center valign-top"><p class="tableblock"><span class="icon lime"><i class="fa fa-check"></i></span></p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>See
<a href="https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#mapper-orm-indexing-automatic-synchronization">this
section of the reference documentation</a>
for more information.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>write-sync</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.automatic-indexing.enable-dirty-check"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.automatic-indexing.enable-dirty-check">quarkus.hibernate-search.automatic-indexing.enable-dirty-check</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Whether to check if dirty properties are relevant to indexing before actually reindexing an entity.
 When enabled, re-indexing of an entity is skipped if the only changes are on properties that are not used when indexing.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.default-backend"></a><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.default-backend">Default backend</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.version"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.version">quarkus.hibernate-search.elasticsearch.version</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The version of Elasticsearch used in the cluster.
 As the schema is generated without a connection to the server, this item is mandatory.
 It doesn&#8217;t have to be the exact version (it can be 7 or 7.1 for instance) but it has to be sufficiently precise to choose a model dialect (the one used to generate the schema) compatible with the protocol dialect (the one used to communicate with Elasticsearch).
 There&#8217;s no rule of thumb here as it depends on the schema incompatibilities introduced by Elasticsearch versions. In any case, if there is a problem, you will have an error when Hibernate Search tries to connect to the cluster.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">ElasticsearchVersion</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.analysis.configurer"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.analysis.configurer">quarkus.hibernate-search.elasticsearch.analysis.configurer</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The class or the name of the bean used to configure full text analysis (e.g. analyzers, normalizers).</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">class name</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.layout.strategy"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.layout.strategy">quarkus.hibernate-search.elasticsearch.layout.strategy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The class or the name of the bean used to configure layout (e.g. index names, index aliases).</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">class name</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.hosts"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.hosts">quarkus.hibernate-search.elasticsearch.hosts</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The list of hosts of the Elasticsearch servers.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>localhost:9200</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.protocol"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.protocol">quarkus.hibernate-search.elasticsearch.protocol</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The protocol to use when contacting Elasticsearch servers. Set to "https" to enable SSL/TLS.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>http</code>, <code>https</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>http</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.username"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.username">quarkus.hibernate-search.elasticsearch.username</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The username used for authentication.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.password"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.password">quarkus.hibernate-search.elasticsearch.password</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The password used for authentication.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.connection-timeout"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.connection-timeout">quarkus.hibernate-search.elasticsearch.connection-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The connection timeout.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>3S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.max-connections"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.max-connections">quarkus.hibernate-search.elasticsearch.max-connections</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum number of connections to all the Elasticsearch servers.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>20</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.max-connections-per-route"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.max-connections-per-route">quarkus.hibernate-search.elasticsearch.max-connections-per-route</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum number of connections per Elasticsearch server.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.discovery.enabled"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.discovery.enabled">quarkus.hibernate-search.elasticsearch.discovery.enabled</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Defines if automatic discovery is enabled.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.discovery.refresh-interval"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.discovery.refresh-interval">quarkus.hibernate-search.elasticsearch.discovery.refresh-interval</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Refresh interval of the node list.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.thread-pool.size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.thread-pool.size">quarkus.hibernate-search.elasticsearch.thread-pool.size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The size of the thread pool assigned to the backend.
 Note that number is <strong>per backend</strong>, not per index. Adding more indexes will not add more threads.
 As all operations happening in this thread-pool are non-blocking, raising its size above the number of processor cores available to the JVM will not bring noticeable performance benefit. The only reason to alter this setting would be to reduce the number of threads; for example, in an application with a single index with a single indexing queue, running on a machine with 64 processor cores, you might want to bring down the number of threads.
 Defaults to the number of processor cores available to the JVM on startup.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.schema-management.required-status"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.schema-management.required-status">quarkus.hibernate-search.elasticsearch.index-defaults.schema-management.required-status</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The minimal cluster status required.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code>, <code>yellow</code>, <code>red</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.schema-management.required-status-wait-timeout"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.schema-management.required-status-wait-timeout">quarkus.hibernate-search.elasticsearch.index-defaults.schema-management.required-status-wait-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>How long we should wait for the status before failing the bootstrap.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.indexing.queue-count"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.indexing.queue-count">quarkus.hibernate-search.elasticsearch.index-defaults.indexing.queue-count</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The number of indexing queues assigned to each index.
 Higher values will lead to more connections being used in parallel, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.indexing.queue-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.indexing.queue-size">quarkus.hibernate-search.elasticsearch.index-defaults.indexing.queue-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The size of indexing queues.
 Lower values may lead to lower memory usage, especially if there are many queues, but values that are too low will reduce the likeliness of reaching the max bulk size and increase the likeliness of application threads blocking because the queue is full, which may lead to lower indexing throughput.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>1000</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.indexing.max-bulk-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.index-defaults.indexing.max-bulk-size">quarkus.hibernate-search.elasticsearch.index-defaults.indexing.max-bulk-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum size of bulk requests created when processing indexing queues.
 Higher values will lead to more documents being sent in each HTTP request sent to Elasticsearch, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.
 Note that raising this number above the queue size has no effect, as bulks cannot include more requests than are contained in the queue.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>100</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.schema-management.required-status"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.schema-management.required-status">quarkus.hibernate-search.elasticsearch.indexes."index-name".schema-management.required-status</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The minimal cluster status required.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code>, <code>yellow</code>, <code>red</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.schema-management.required-status-wait-timeout"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.schema-management.required-status-wait-timeout">quarkus.hibernate-search.elasticsearch.indexes."index-name".schema-management.required-status-wait-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>How long we should wait for the status before failing the bootstrap.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.indexing.queue-count"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.indexing.queue-count">quarkus.hibernate-search.elasticsearch.indexes."index-name".indexing.queue-count</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The number of indexing queues assigned to each index.
 Higher values will lead to more connections being used in parallel, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.indexing.queue-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.indexing.queue-size">quarkus.hibernate-search.elasticsearch.indexes."index-name".indexing.queue-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The size of indexing queues.
 Lower values may lead to lower memory usage, especially if there are many queues, but values that are too low will reduce the likeliness of reaching the max bulk size and increase the likeliness of application threads blocking because the queue is full, which may lead to lower indexing throughput.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>1000</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.indexing.max-bulk-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.indexes.-index-name-.indexing.max-bulk-size">quarkus.hibernate-search.elasticsearch.indexes."index-name".indexing.max-bulk-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum size of bulk requests created when processing indexing queues.
 Higher values will lead to more documents being sent in each HTTP request sent to Elasticsearch, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.
 Note that raising this number above the queue size has no effect, as bulks cannot include more requests than are contained in the queue.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>100</code></p></td>
</tr>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.additional-backends"></a><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.additional-backends">Additional backends</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.default-backend"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.default-backend">quarkus.hibernate-search.elasticsearch.default-backend</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Only useful when defining <code>backends additional backends</code>: the name of the default backend, i.e. the backend that will be assigned to <code>@Indexed</code> entities that do not specify a backend explicitly through <code>@Indexed(backend = &#8230;&#8203;)</code>.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.version"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.version">quarkus.hibernate-search.elasticsearch.backends."backend-name".version</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The version of Elasticsearch used in the cluster.
 As the schema is generated without a connection to the server, this item is mandatory.
 It doesn&#8217;t have to be the exact version (it can be 7 or 7.1 for instance) but it has to be sufficiently precise to choose a model dialect (the one used to generate the schema) compatible with the protocol dialect (the one used to communicate with Elasticsearch).
 There&#8217;s no rule of thumb here as it depends on the schema incompatibilities introduced by Elasticsearch versions. In any case, if there is a problem, you will have an error when Hibernate Search tries to connect to the cluster.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">ElasticsearchVersion</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.analysis.configurer"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.analysis.configurer">quarkus.hibernate-search.elasticsearch.backends."backend-name".analysis.configurer</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The class or the name of the bean used to configure full text analysis (e.g. analyzers, normalizers).</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">class name</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.layout.strategy"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.layout.strategy">quarkus.hibernate-search.elasticsearch.backends."backend-name".layout.strategy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The class or the name of the bean used to configure layout (e.g. index names, index aliases).</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">class name</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.hosts"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.hosts">quarkus.hibernate-search.elasticsearch.backends."backend-name".hosts</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The list of hosts of the Elasticsearch servers.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>localhost:9200</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.protocol"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.protocol">quarkus.hibernate-search.elasticsearch.backends."backend-name".protocol</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The protocol to use when contacting Elasticsearch servers. Set to "https" to enable SSL/TLS.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>http</code>, <code>https</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>http</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.username"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.username">quarkus.hibernate-search.elasticsearch.backends."backend-name".username</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The username used for authentication.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.password"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.password">quarkus.hibernate-search.elasticsearch.backends."backend-name".password</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The password used for authentication.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.connection-timeout"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.connection-timeout">quarkus.hibernate-search.elasticsearch.backends."backend-name".connection-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The connection timeout.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>3S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.max-connections"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.max-connections">quarkus.hibernate-search.elasticsearch.backends."backend-name".max-connections</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum number of connections to all the Elasticsearch servers.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>20</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.max-connections-per-route"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.max-connections-per-route">quarkus.hibernate-search.elasticsearch.backends."backend-name".max-connections-per-route</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum number of connections per Elasticsearch server.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.discovery.enabled"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.discovery.enabled">quarkus.hibernate-search.elasticsearch.backends."backend-name".discovery.enabled</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Defines if automatic discovery is enabled.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.discovery.refresh-interval"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.discovery.refresh-interval">quarkus.hibernate-search.elasticsearch.backends."backend-name".discovery.refresh-interval</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Refresh interval of the node list.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.thread-pool.size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.thread-pool.size">quarkus.hibernate-search.elasticsearch.backends."backend-name".thread-pool.size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The size of the thread pool assigned to the backend.
 Note that number is <strong>per backend</strong>, not per index. Adding more indexes will not add more threads.
 As all operations happening in this thread-pool are non-blocking, raising its size above the number of processor cores available to the JVM will not bring noticeable performance benefit. The only reason to alter this setting would be to reduce the number of threads; for example, in an application with a single index with a single indexing queue, running on a machine with 64 processor cores, you might want to bring down the number of threads.
 Defaults to the number of processor cores available to the JVM on startup.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.schema-management.required-status"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.schema-management.required-status">quarkus.hibernate-search.elasticsearch.backends."backend-name".index-defaults.schema-management.required-status</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The minimal cluster status required.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code>, <code>yellow</code>, <code>red</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.schema-management.required-status-wait-timeout"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.schema-management.required-status-wait-timeout">quarkus.hibernate-search.elasticsearch.backends."backend-name".index-defaults.schema-management.required-status-wait-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>How long we should wait for the status before failing the bootstrap.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.indexing.queue-count"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.indexing.queue-count">quarkus.hibernate-search.elasticsearch.backends."backend-name".index-defaults.indexing.queue-count</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The number of indexing queues assigned to each index.
 Higher values will lead to more connections being used in parallel, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.indexing.queue-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.indexing.queue-size">quarkus.hibernate-search.elasticsearch.backends."backend-name".index-defaults.indexing.queue-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The size of indexing queues.
 Lower values may lead to lower memory usage, especially if there are many queues, but values that are too low will reduce the likeliness of reaching the max bulk size and increase the likeliness of application threads blocking because the queue is full, which may lead to lower indexing throughput.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>1000</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.indexing.max-bulk-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.index-defaults.indexing.max-bulk-size">quarkus.hibernate-search.elasticsearch.backends."backend-name".index-defaults.indexing.max-bulk-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum size of bulk requests created when processing indexing queues.
 Higher values will lead to more documents being sent in each HTTP request sent to Elasticsearch, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.
 Note that raising this number above the queue size has no effect, as bulks cannot include more requests than are contained in the queue.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>100</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.schema-management.required-status"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.schema-management.required-status">quarkus.hibernate-search.elasticsearch.backends."backend-name".indexes."index-name".schema-management.required-status</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The minimal cluster status required.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code>, <code>yellow</code>, <code>red</code></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>green</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.schema-management.required-status-wait-timeout"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.schema-management.required-status-wait-timeout">quarkus.hibernate-search.elasticsearch.backends."backend-name".indexes."index-name".schema-management.required-status-wait-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>How long we should wait for the status before failing the bootstrap.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.indexing.queue-count"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.indexing.queue-count">quarkus.hibernate-search.elasticsearch.backends."backend-name".indexes."index-name".indexing.queue-count</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The number of indexing queues assigned to each index.
 Higher values will lead to more connections being used in parallel, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.indexing.queue-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.indexing.queue-size">quarkus.hibernate-search.elasticsearch.backends."backend-name".indexes."index-name".indexing.queue-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The size of indexing queues.
 Lower values may lead to lower memory usage, especially if there are many queues, but values that are too low will reduce the likeliness of reaching the max bulk size and increase the likeliness of application threads blocking because the queue is full, which may lead to lower indexing throughput.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>1000</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.indexing.max-bulk-size"></a><code><a href="#quarkus-hibernate-search-elasticsearch_quarkus.hibernate-search.elasticsearch.backends.-backend-name-.indexes.-index-name-.indexing.max-bulk-size">quarkus.hibernate-search.elasticsearch.backends."backend-name".indexes."index-name".indexing.max-bulk-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum size of bulk requests created when processing indexing queues.
 Higher values will lead to more documents being sent in each HTTP request sent to Elasticsearch, which may lead to higher indexing throughput, but incurs a risk of overloading Elasticsearch, i.e. of overflowing its HTTP request buffers and tripping <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/circuit-breaker.html">circuit breakers</a>, leading to Elasticsearch giving up on some request and resulting in indexing failures.
 Note that raising this number above the queue size has no effect, as bulks cannot include more requests than are contained in the queue.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>100</code></p></td>
</tr>
</tbody>
</table>
<div id="duration-note-anchor" class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">About the Duration format</div>
<div class="paragraph">
<p>The format for durations uses the standard <code>java.time.Duration</code> format.
You can learn more about it in the <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-">Duration#parse() javadoc</a>.</p>
</div>
<div class="paragraph">
<p>You can also provide duration values starting with a number.
In this case, if the value consists only of a number, the converter treats the value as seconds.
Otherwise, <code>PT</code> is implicitly prepended to the value to obtain a standard <code>java.time.Duration</code> format.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
